package com.huijie.core.bean;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @ClassName ResponseBean
 * @Description Restful Api 返回实体, code+message+data
 * @Author Alex
 * @Date 2018/9/20 19:45
 * @Version 1.0
 */
@ApiModel
public class ResponseBean  implements Serializable  {

	private static final long serialVersionUID = -4230912896449952924L;

	//返回码
	@ApiModelProperty(value = "返回码")
    private int code;

    // 返回信息
	@ApiModelProperty(value = "返回码描述")
    private String message;

    // 数据对象
	@ApiModelProperty(value = "数据对象")
    private Object data;

    public int getCode() {
        return code;
    }
    
    public ResponseBean(int code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ResponseBean(int code, String message) {
    	this.code = code;
        this.message = message;
	}
    
    public ResponseBean() {
	}

	public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
    
    @Override
    public String toString() {
        return "JSONResult [code=" + code + ", data=" + data + ", message="
                + message + "]";
    }
}
